<?php
require_once "./ScreenShotsService.php"
// chenlin
// 处理请求的转发
// 2022年10月9日15:39:43

// 获取请求指令
$act = isset($_REQUEST['act']) ? $_REQUEST['act'] : '';

//返回参数
$addTaskRes = array(
    "code"=>200,
    "msg"=>"",
    "taskid"=>0,
    "md5"=>""
);

$getImageRes = array(
    "code"=>200,
    "msg"=>"",
    "imageUrl"=>""
);

$getTaskStatusRes = array(

);
switch ($act) {
    case "addTask":
        $business = isset($_REQUEST['business']) ? $_REQUEST['business'] :'';
        $redictURL = isset($_REQUEST['redictURL']) ? $_REQUEST['redictURL'] : '';
        $url = isset($_REQUEST['url']) ? $_REQUEST['url'] : '';
        $type = isset($_REQUEST['type']) ? $_REQUEST['type'] : '';
        $scrollHeight = isset($_REQUEST['scrollHeight']) ? $_REQUEST['scrollHeight'] : '';
        $param = array(
            "business"=>$business,
            "redictURL"=>$redictURL,
            "url"=>$url,
            "type"=>$type,
            "scrollHeight"=>$scrollHeight
        );
        addTask($param);
        break;
    case "getImage":
        $taskId = isset($_REQUEST['taskId']) ? $_REQUEST['taskId'] : '';
        $md5 = isset($_REQUEST['md5']) ? $_REQUEST['md5'] : '';
        $parma = array(
            "taskId"=>$taskId,
            "md5"=>$md5
        );
        getImages($parma);
        break;
    case "getTaskStatus":

        break;
    default:
        //参数错误
}



?>